import HttpUtils from '../HttpUtils/HttpUtils';
// 获取当前时间戳
var timestamp = Date.parse(new Date()) / 1000;
let globalData = getApp().globalData;

Page({
	...HttpUtils.func,
	data: {
		party: {}
	},
	onLoad() {
		this.loadPartyBranch();
	},
	loadPartyBranch: function() {
		let newUrl = globalData.dangjianUrl + '/party/partyInfo',
	        params = {};
            params['partyId'] = globalData.partyId;
            params = JSON.stringify(params);

		this.httpGet(newUrl, params, '支部简介加载失败').then(
			(respData) => {
				var result = respData.data.result.code;
				if (+result == 1) {
					var party = respData.data.party;
					this.setData({
						'party': party
					});
                    console.log(party);
				} else {
                    this.showPageMsg('alert', respData.data.result.description);
				}
			}
		);
	}
});
